using Prism.Mvvm;
using System.Collections.ObjectModel;

namespace Tryit.ViewModels
{
    public class StatisticsViewModel : BindableBase
    {
        private ObservableCollection<PersonStatistics> _personStatistics;
        public ObservableCollection<PersonStatistics> PersonStatistics
        {
            get => _personStatistics;
            set => SetProperty(ref _personStatistics, value);
        }

        public StatisticsViewModel()
        {
            PersonStatistics = new ObservableCollection<PersonStatistics>();
        }

        public void UpdateStatistics(ObservableCollection<PersonStatistics> statistics)
        {
            PersonStatistics.Clear();
            foreach (var stat in statistics)
            {
                PersonStatistics.Add(stat);
            }
        }
    }
} 